import { getSearchListRequest } from "@/api";

//search 模块化
const state = {
  searchList: {},
};
const mutations = {
  SET_TRADEMARKLIST(state, value) {
    state.searchList = value;
  },
};
const actions = {
  async getSearchList({ commit }, params) {
    console.log(params);
    const result = await getSearchListRequest(params);
    commit("SET_TRADEMARKLIST", result);
  },
};
const getters = {
  goodsList() {
    return state.searchList.goodsList;
  },
  attrsList() {
    return state.searchList.attrsList;
  },
  trademarkList() {
    return state.searchList.trademarkList;
  },
};

export default {
  //开启命名空间
  namespaced: true,
  state,
  mutations,
  actions,
  getters,
};
